package o;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol.Request;
import o.der.f;
import o.der.g;

public final class egs {
    private static egs ˊ;

    static class d implements OnClickListener {
        Context ॱ;

        public d(Context context) {
            this.ॱ = context;
        }

        public void onClick(DialogInterface dialogInterface, int i) {
            cjo appDetailActivityProtocol = new AppDetailActivityProtocol();
            appDetailActivityProtocol.ˏ(new Request(drj.ॱ("com.huawei.hwid"), null));
            cjk.ˎ().ˋ(this.ॱ, new cjm("appdetail.activity", appDetailActivityProtocol));
        }
    }

    private egs() {
    }

    public static synchronized egs ॱ() {
        egs o_egs;
        synchronized (egs.class) {
            if (ˊ == null) {
                ˊ = new egs();
            }
            o_egs = ˊ;
        }
        return o_egs;
    }

    public int ˏ() {
        return ehb.ˏ().ˋ();
    }

    public void ˊ(int i) {
        ehb.ˏ().ˋ(i);
    }

    public AlertDialog ˋ(Context context) {
        Builder negativeButton = new Builder(context).setMessage(null).setPositiveButton(f.ˈॱ, new d(context)).setNegativeButton(f.ͺˏ, null);
        negativeButton.setView(ˎ(context));
        return negativeButton.create();
    }

    private View ˎ(Context context) {
        LinearLayout linearLayout = (LinearLayout) LayoutInflater.from(context).inflate(g.ͺ, null);
        TextView textView = (TextView) linearLayout.findViewById(o.der.d.ˉॱ);
        ((TextView) linearLayout.findViewById(o.der.d.ˈॱ)).setText(context.getString(f.ॱˎ));
        textView.setText(context.getString(f.ˋʻ));
        return linearLayout;
    }

    public boolean ˏ(Context context) {
        if (dnx.ˏ("com.huawei.hwid", context) == null) {
            return false;
        }
        return true;
    }
}
